﻿@{
    ViewBag.Title = "Agency";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script>
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            //treeGrid: true,
            treeGridModel: "adjacency",
            ExpandColumn: "F_CreatorTime",
            url: "/SystemManage/Area/GetTreeGridAg",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "F_Id", hidden: true, key: true }, 
                { label: '名称', name: 'F_FullName', width: 200, align: 'left' },
                //{
                //    label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
                //    formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
                //},
                //{
                //    label: "有效", name: "F_EnabledMark", width: 60, align: "center",
                //    formatter: function (cellvalue) {
                //        return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
                //    }
                //},  formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
                { label: '代理人ID', name: 'UserCode', width: 300, align: 'left' },
                { label: '代理人姓名', name: 'UserName', width: 300, align: 'left' },
                {
                    label: '代理时间', name: 'UserCreatorTime', width: 80, align: 'left',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
                },
            ]
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { keyword: $("#txt_keyword").val() },
            }).trigger('reloadGrid');
        });
    }
</script>

<div class="topPanel">
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar">
        <div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <script>$('.toolbar').authorizeButton()</script>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
</div>

